home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
DATABASE.DIR
/
00081_Script_DB INITIALIZE-LEAVE
< prev
next >
Wrap
Text File
|
1996-03-28
|
8KB
|
264 lines
-- ---------------------------------------------------------------
-- NOTE: Make sure the field "browserTopics" has a blank line
-- at the end. This ensures that the field "browser" will alsways
-- end with a blank line. If not, when you click on the last line
-- in the browser, for some strange reason, the line disappears and
-- does not hilite.
-- ---------------------------------------------------------------
-- Handler initializeData initializes the database.
on initializeData
waitcursor
clearSearchTopicField
setDatabaseButtonDefault
initIndexIndex
setDatabaseSprites
setDatabasePuppets
setDatabaseCursors
setDatabaseConstraints
setDatabaseTextGlobals
setDatabaseBrowserGlobals
setDatabaseFieldAttributes
setDatabaseMisc
initTextCastNumbersList
initalizeEquivalentTerms
clearDatabase
setBrowserText
normalcursor
end
-- ---------------------------------------------------------------
-- Handler setDatabaseButtonDefault sets the default button states.
on setDatabaseButtonDefault whichType
global defaultButtonStates
set defaultButtonStates = "text 1:picture 0"
if whichType = "Help" then
-- set buttons on or off stage
else if whichType = "Database" then
-- set buttons on or off stage
end if
end
-- ---------------------------------------------------------------
-- Handler setDatabaseSprites defines and initializes the global
-- variables used to store the sprite information in the database.
on setDatabaseSprites
global browser, textSprite, title
global browserScroll
global indexButton, searchButton, findButton, inputField
global mediaButton, pictureButton, textButton
global hilitTopic, hiliteSprite
global pageUpButton, pageDownButton, pictureSprite,constraintScrollBar
global lineSprite,origScrollPos, captionSprite
set origScrollPos = 158
set indexButton = 2
set searchButton = 3
set findButton = 4
set mediaButton = 5
set textButton = 6
set pictureButton = 7
set constraintScrollBar = 11
set browserScroll = 12
set browser = 13
set textSprite = 14
set title = 15
set inputField = 16
set hilitTopic = 17
set pictureSprite = 18
set pageUpButton = 19
set pageDownButton = 20
set captionSprite = 21
set lineSprite = 23
end
-- ---------------------------------------------------------------
-- Handler setDatabasePuppets sets the database puppets.
on setDatabasePuppets
global textButton, pictureButton, mediaButton
global indexButton, searchButton, findButton, inputField
global browserScroll, hilitTopic, textSprite
global pageUpButton, pageDownButton, pictureSprite
puppetSprite textButton, TRUE
puppetSprite pictureButton, TRUE
puppetSprite mediaButton, TRUE
puppetSprite indexButton, TRUE
puppetSprite searchButton, TRUE
puppetSprite findButton, TRUE
puppetSprite inputField, TRUE
puppetSprite browserScroll, TRUE
puppetSprite hilitTopic, TRUE
puppetSprite textSprite, TRUE
puppetSprite pageUpButton, TRUE
puppetSprite pageDownButton, TRUE
puppetSprite pictureSprite, TRUE
puppetSprite captionSprite, TRUE
end
-- ---------------------------------------------------------------
-- Handler setDatabaseCursors sets the database cursors.
on setDatabaseCursors
global fingerCursor, browserScroll, searchSprite
global searchButton, indexButton, mediaButton
global pageUpButton, pageDownButton
set the cursor of sprite mediaButton = fingerCursor
set the cursor of sprite searchButton = fingerCursor
set the cursor of sprite indexButton = fingerCursor
set the cursor of sprite browserScroll = fingerCursor
set the cursor of sprite 9 = fingerCursor -- browser scrollup arrow
set the cursor of sprite 8 = fingerCursor -- browser scrollDown arrow
set the cursor of sprite pageDownButton = fingerCursor -- nextPage
set the cursor of sprite pageUpButton = fingerCursor -- prevPage
end
-- ---------------------------------------------------------------
-- Handler setDatabaseConstraints sets the constraint of the
-- scroll button.
on setDatabaseConstraints
global browserScroll, constraintScrollBar
set the constraint of sprite browserScroll = constraintScrollBar
end
-- ---------------------------------------------------------------
-- Handler setDatabaseTextGlobals sets the global variables used
-- for the text in the database.
on setDatabaseTextGlobals
global textColor, bkgndColor, regularStyle, hilitBackground, hilitForeground
global hilitTextColor, hypertextHiliteColor, hyperMediaLinkColor
set regularStyle = "plain"
set textColor = 255 -- black
set bkgndColor = 0 -- grey
set hilitBackground = 8
set hilitForeground =255 -- bkgndColor
set hilitTextColor = 235 -- bright blue
set hypertextHiliteColor = 230 -- green
set hyperMediaLinkColor = 35 -- bright red
end
-- ---------------------------------------------------------------
-- Handler setDatabaseFieldAttributes
on setDatabaseFieldAttributes
-- set the attributes of the browser
setBrowserAttributes
-- set the attributes of the hiliteText field
setHilitTopicAttributes
-- set the attributes of the title field
setTitleAttributes
end
-- ---------------------------------------------------------------
-- Handler setDatabaseMisc
on setDatabaseMisc
-- set globals for history of links
-- global numRecent
-- set numRecent = 5
-- resetRecentChoices
-- set page up and down button locations
global pageUpH, pageUpV, pageDownH, pageDownV
set pageUpH = 535
set pageUpV = 417
set pageDownH = 535
set pageDownV = 433
-- Misc.
global alphabetTopicStarts
put field "AlphabetLineStarts" into alphabetTopicStarts
set the keyDownScript = "displayKeyLineAtTop"
set the keyUpScript = EMPTY
setClearedFlag(FALSE)
setIndexMode
global buttonStates
set buttonStates = field "button states"
global pictureL, pictureR,pictureT, pictureB,pictureSprite
set pictureR = 560
set pictureL = 320
set pictureT = 63
set pictureB = 417
global pictureH, pictureV
set pictureH = 388
set pictureV = 250
set the stretch of sprite pictureSprite =FALSE
global captionV, captionH, captionSprite
set captionH = 238
set captionV = 58
setCaptionAttributes(the castNum of sprite captionSprite)
global numPagesAll, numPicturesAll
set numPagesAll = field "numPages per Topic"
set numPicturesAll = field "numPictures per Topic"
global pictureTitles
set pictureTitles = field "pictureTitles"
global mediaTopics
set mediaTopics = field "mediaTopics"
global textSprite
set the editableText of sprite textSprite = FALSE
end
-- ---------------------------------------------------------------
-- Handler leaveDB gets director ready for the next movie (shuts
-- off the puppets used in the database etc.) To be put in the
-- script of the moveable directional button.
on leaveDB
setClearedFlag(false)
clearDatabase
global IndexIndex1, IndexIndex2, IndexIndex3, IndexIndex4
set indexIndex1 = ""
set indexIndex2 = ""
set indexIndex3 = ""
set indexIndex4 = ""
global browserTopics, masterBrowserTopics
set browserTopics = EMPTY
set masterBrowserTopics = EMPTY
set the keyDownScript = EMPTY
set the keyUpScript = EMPTY
clearSearchTopicField -- for next time
put " " into field "browser"
-- reset puppets
-- reset cursors
sound stop 1
pass -- to cast script of the clicked button that takes you out of the database
end
-- ---------------------------------------------------------------
-- Handler stopMovie
on stopMovie
leaveDB
end